#!/usr/bin/perl

$FILE='access.log'; $FILE_SIZE=20;
open(LOG, $FILE);
$i=1;
$j=1;
while($line=<LOG>){
  if($i%$FILE_SIZE !=0)
    {
      print "FILE.$j\n";
      open(TMP,">>File_$j.txt");
      print TMP $line;
      close(TMP);
    }
  else
    {
      open(TMP,">>File_$j.txt");
      print TMP $line;
      close(TMP);
      $j++;
#      print "FILE.$j\n";
    }
  $i++;

}
close(LOG);
